var $ = getApp(), methods = require("../methods.js");
Page(Object.assign({}, methods, {
	data: {
		prodata: '',
		isload: 0,
		hiddenmodalremark:true,
		remarkdata:'',
		hiddenmodalremark2:true,
		remarkdata2:'',
	},
	_onLoad: function (option) {
		var that = this;
		wx.setNavigationBarTitle({
			title: (that.data.textset['会员'] || '会员')+'信息'
		});
		$.post($.pre_url + '/am.php?s=/member/detail', { mid: that.options.mid }, function (data) {
			that.setData({
				member: data.member,
				isload: 1
			});
			$.loading(false);
		});
	},
	recharge:function(e){
		var that = this;
		that.setData({hiddenmodalremark:false})
	},
	cancelremark:function(e){
		var that = this;
		that.setData({hiddenmodalremark:true})
	},
	setremarkdata:function(e){
		var that = this;
		that.setData({remarkdata:e.detail.value})
	},
	setremarkconfirm:function(){
		var that = this
		$.post($.pre_url + '/am.php?s=/member/recharge', {rechargemid: that.options.mid,rechargemoney:that.data.remarkdata }, function (data) {
			$.success(data.msg);
			that.setData({hiddenmodalremark:true})
			setTimeout(function () {
				that._onLoad();
			}, 1000)
		})
	},
	addscore:function(e){
		var that = this;
		that.setData({hiddenmodalremark2:false})
	},
	cancelremark2:function(e){
		var that = this;
		that.setData({hiddenmodalremark2:true})
	},
	setremarkdata2:function(e){
		var that = this;
		that.setData({remarkdata2:e.detail.value})
	},
	setremarkconfirm2:function(){
		var that = this
		$.post($.pre_url + '/am.php?s=/member/addscore', {rechargemid: that.options.mid,rechargescore:that.data.remarkdata2 }, function (data) {
			$.success(data.msg);
			that.setData({hiddenmodalremark2:true})
			setTimeout(function () {
				that._onLoad();
			}, 1000)
		})
	},
}))